/*********************\
* Author:Dzlua
* QQ:505544956
* Time:2017/04/15
\**********************/
#include "LuaListContainerHeaderItem.h"

#define CObjPtr ((CListContainerHeaderItemUI*)m_cobj)

namespace DuiLib {


void LuaListContainerHeaderItem::SetEnabled(bool bEnable)
{
    CObjPtr->SetEnabled(bEnable);
}

bool LuaListContainerHeaderItem::IsDragable()
{
    return CObjPtr->IsDragable();
}

void LuaListContainerHeaderItem::SetDragable(bool bDragable)
{
    CObjPtr->SetDragable(bDragable);
}

DWORD LuaListContainerHeaderItem::GetSepWidth()
{
    return CObjPtr->GetSepWidth();
}

void LuaListContainerHeaderItem::SetSepWidth(int iWidth)
{
    CObjPtr->SetSepWidth(iWidth);
}

DWORD LuaListContainerHeaderItem::GetTextStyle()
{
    return CObjPtr->GetTextStyle();
}

void LuaListContainerHeaderItem::SetTextStyle(UINT uStyle)
{
    CObjPtr->SetTextStyle(uStyle);
}

DWORD LuaListContainerHeaderItem::GetTextColor()
{
    return CObjPtr->GetTextColor();
}

void LuaListContainerHeaderItem::SetTextColor(DWORD dwTextColor)
{
    CObjPtr->SetTextColor(dwTextColor);
}

int LuaListContainerHeaderItem::SetTextPadding(LuaState *L)
{
    LuaStack args(L);
    RECT rc = LuaHelperNS::GetRect(args[2]);
    CObjPtr->SetTextPadding(rc);
    return 0;
}

int LuaListContainerHeaderItem::GetTextPadding(LuaState *L)
{
    RECT rc = CObjPtr->GetTextPadding();
    LuaHelperNS::PushRect(L, rc);
    return 1;
}

void LuaListContainerHeaderItem::SetFont(int index)
{
    CObjPtr->SetFont(index);
}

bool LuaListContainerHeaderItem::IsShowHtml()
{
    return CObjPtr->IsShowHtml();
}

void LuaListContainerHeaderItem::SetShowHtml(bool bShowHtml)
{
    CObjPtr->SetShowHtml(bShowHtml);
}

int LuaListContainerHeaderItem::GetNormalImage(LuaState *L)
{
    SDTString str = CObjPtr->GetNormalImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaListContainerHeaderItem::SetNormalImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetNormalImage(str.c_str());
    return 0;
}

int LuaListContainerHeaderItem::GetHotImage(LuaState *L)
{
    SDTString str = CObjPtr->GetHotImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaListContainerHeaderItem::SetHotImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetHotImage(str.c_str());
    return 0;
}

int LuaListContainerHeaderItem::GetPushedImage(LuaState *L)
{
    SDTString str = CObjPtr->GetPushedImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaListContainerHeaderItem::SetPushedImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetForeImage(str.c_str());
    return 0;
}

int LuaListContainerHeaderItem::GetFocusedImage(LuaState *L)
{
    SDTString str = CObjPtr->GetFocusedImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaListContainerHeaderItem::SetFocusedImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetFocusedImage(str.c_str());
    return 0;
}

int LuaListContainerHeaderItem::GetSepImage(LuaState *L)
{
    SDTString str = CObjPtr->GetSepImage();
    LuaHelperNS::PushTString(L, str);
    return 1;
}

int LuaListContainerHeaderItem::SetSepImage(LuaState *L)
{
    LuaStack args(L);
    SDTString str = LuaHelperNS::GetTString(args[2]);
    CObjPtr->SetSepImage(str.c_str());
    return 0;
}

int LuaListContainerHeaderItem::EstimateSize(LuaState *L)
{
    LuaStack args(L);
    SIZE szAvailable = LuaHelperNS::GetSize(args[2]);
    SIZE sz = CObjPtr->EstimateSize(szAvailable);
    LuaHelperNS::PushSize(L, sz);
    return 1;
}

int LuaListContainerHeaderItem::GetThumbRect(LuaState *L)
{
    RECT rc = CObjPtr->GetThumbRect();
    LuaHelperNS::PushRect(L, rc);
    return 1;
}

SDLUA_BEGIN_REGISTER(LuaListContainerHeaderItem, ListContainerHeaderItem, HorizontalLayout)
    SDLUA_REGISTER_FUN_CPP(LuaListContainerHeaderItem, SetEnabled, SetEnabled)
    SDLUA_REGISTER_FUN_CPP(LuaListContainerHeaderItem, IsDragable, IsDragable)
    SDLUA_REGISTER_FUN_CPP(LuaListContainerHeaderItem, SetDragable, SetDragable)
    SDLUA_REGISTER_FUN_CPP(LuaListContainerHeaderItem, GetSepWidth, GetSepWidth)
    SDLUA_REGISTER_FUN_CPP(LuaListContainerHeaderItem, SetSepWidth, SetSepWidth)
    SDLUA_REGISTER_FUN_CPP(LuaListContainerHeaderItem, GetTextStyle, GetTextStyle)
    SDLUA_REGISTER_FUN_CPP(LuaListContainerHeaderItem, SetTextStyle, SetTextStyle)
    SDLUA_REGISTER_FUN_CPP(LuaListContainerHeaderItem, GetTextColor, GetTextColor)
    SDLUA_REGISTER_FUN_CPP(LuaListContainerHeaderItem, SetTextColor, SetTextColor)
    SDLUA_REGISTER_FUN_LUA(LuaListContainerHeaderItem, SetTextPadding, SetTextPadding)
    SDLUA_REGISTER_FUN_LUA(LuaListContainerHeaderItem, GetTextPadding, GetTextPadding)
    SDLUA_REGISTER_FUN_CPP(LuaListContainerHeaderItem, SetFont, SetFont)
    SDLUA_REGISTER_FUN_CPP(LuaListContainerHeaderItem, IsShowHtml, IsShowHtml)
    SDLUA_REGISTER_FUN_CPP(LuaListContainerHeaderItem, SetShowHtml, SetShowHtml)

    SDLUA_REGISTER_FUN_LUA(LuaListContainerHeaderItem, GetNormalImage, GetNormalImage)
    SDLUA_REGISTER_FUN_LUA(LuaListContainerHeaderItem, SetNormalImage, SetNormalImage)
    SDLUA_REGISTER_FUN_LUA(LuaListContainerHeaderItem, GetHotImage, GetHotImage)
    SDLUA_REGISTER_FUN_LUA(LuaListContainerHeaderItem, SetHotImage, SetHotImage)
    SDLUA_REGISTER_FUN_LUA(LuaListContainerHeaderItem, GetPushedImage, GetPushedImage)
    SDLUA_REGISTER_FUN_LUA(LuaListContainerHeaderItem, SetPushedImage, SetPushedImage)
    SDLUA_REGISTER_FUN_LUA(LuaListContainerHeaderItem, GetFocusedImage, GetFocusedImage)
    SDLUA_REGISTER_FUN_LUA(LuaListContainerHeaderItem, SetFocusedImage, SetFocusedImage)
    SDLUA_REGISTER_FUN_LUA(LuaListContainerHeaderItem, GetSepImage, GetSepImage)
    SDLUA_REGISTER_FUN_LUA(LuaListContainerHeaderItem, SetSepImage, SetSepImage)
    
    SDLUA_REGISTER_FUN_LUA(LuaListContainerHeaderItem, EstimateSize, EstimateSize)
    SDLUA_REGISTER_FUN_LUA(LuaListContainerHeaderItem, GetThumbRect, GetThumbRect)

SDLUA_END_REGISTER

SDLUA_BEGIN_UNREGISTER(LuaListContainerHeaderItem, ListContainerHeaderItem)
SDLUA_END_UNREGISTER(ListContainerHeaderItem)

}

#undef CObjPtr